﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace App.Controllers
{
    [Authorize]
    public class BaseController : Controller
    {
        /// <summary>
        /// 系统用户编号
        /// </summary>
        public string UserId
        {
            get
            {
                if (User.Identity.IsAuthenticated) { 
                    return User.Identity.Name.Split('-')[0];
                }
                else
                    return string.Empty;

            }
        }

        public string UserName
        {
            get
            {
                if (User.Identity.IsAuthenticated)
                {
                    return User.Identity.Name.Split('-')[1];
                }
                else
                    return string.Empty;

            }
        }
    }
}